
<link rel="stylesheet"
	href="/static/zTree_v3/css/zTreeStyle/zTreeStyle.css" type="text/css">

<div class="box">
	<div class="box-header with-border">
		<h3 class="box-title">角色授权</h3>

		<div class="box-tools pull-right">
			<button type="button" class="btn btn-box-tool" data-widget="collapse">
				<i class="fa fa-minus"></i>
			</button>
			<div class="btn-group">
				<button type="button" class="btn btn-box-tool dropdown-toggle"
					data-toggle="dropdown">
					<i class="fa fa-wrench"></i>
				</button>
				<ul class="dropdown-menu" role="menu">
					<li><a href="#">Action</a></li>
				</ul>
			</div>
			<button type="button" class="btn btn-box-tool" data-widget="remove">
				<i class="fa fa-times"></i>
			</button>
		</div>
	</div>
	<!-- /.box-header -->
	<div class="box-body row" style="">
	
		<div class="col-lg-4">
			<div class="box-header with-border">
				<h3 class="box-title">角色管理</h3>
			</div>
			<!-- /.box-header -->
			<div class="box-body" style="">
				<ul id="role_tree_id" class="ztree">
				</ul>
			</div>
			<!-- ./box-body -->
			<div class="box-footer" style="">
				<button type="button" class="btn btn-primary" id="add_role_btn_id">
					<i class="fa fa-plus"></i>添加
				</button>
				<button type="button" class="btn btn-danger" id="del_role_btn_id">
					<i class="fa fa-remove"></i>删除
				</button>
				<button type="button" class="btn btn-warning" id="up_role_btn_id">
					<i class="fa fa-edit"></i>修改
				</button>
			</div>
		</div>
	
		<div class="col-lg-4">
			<div class="box-header with-border">
				<h3 class="box-title">权限管理</h3>
			</div>
			<div class="box-body">
				<ul id="permission_tree_id" class="ztree"></ul>
			</div>
			<div class="box-footer" style="">
				<button type="button" class="btn btn-primary"
					id="add_permission_btn_id">
					<i class="fa fa-plus"></i>添加
				</button>
				<button type="button" class="btn btn-danger"
					id="del_permission_btn_id">
					<i class="fa fa-remove"></i>删除
				</button>
				<button type="button" class="btn btn-warning"
					id="up_permission_btn_id">
					<i class="fa fa-edit"></i>修改
				</button>
			</div>
		</div>
		
		<div class="col-lg-4">
			<div class="box-header with-border">
				<h3 class="box-title">授权操作</h3>
			</div>
			<!-- /.box-header -->
			<div class="box-body" style="">
				<button type="button" class="btn btn-success" id="up_role_perm__btn_id">
					<i class="fa fa-save"></i>授权
				</button>
			</div>
			<!-- ./box-body -->
			<div class="box-footer" style="">
			</div>
		</div>
	</div>
	<!-- ./box-body -->

</div>

<div class="modal fade modalIndex" id="add_permission_Modal" role="dialog">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h4 class="modal-title">添加权限</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" action="#" id="add_perm_form_id">
					<div class="form-group">
						<label for="add_perm_name" class="col-sm-2 control-label">名称</label>

						<div class="col-sm-10">
							<input type="text" class="form-control" id="add_perm_name"
								name="name" placeholder="name">
						</div>
					</div>

					<div class="form-group">
						<label for="add_perm_permission" class="col-sm-2 control-label">映射</label>

						<div class="col-sm-10">
							<input type="text" class="form-control" id="add_perm_permission"
								name="stringPermission" placeholder="permission">
						</div>
					</div>

					<div class="form-group">
						<label for="add_perm_icon" class="col-sm-2 control-label">图标</label>

						<div class="col-sm-10">
							<select id="add_perm_icon" class="form-control select2" style="width:80px"></select>
						</div>
					</div>

					<div class="form-group">
						<div class="col-sm-12">
							<button type="reset" class="btn btn-warning pull-left">重置</button>
							<button type="button" class="btn btn-info pull-right"
								id="add_permission_submit_btn_id">提交</button>
						</div>
					</div>
				</form>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
</div>


<div class="modal fade modalIndex" id="up_permission_Modal" role="dialog">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h4 class="modal-title">修改权限</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" action="#" id="up_perm_form_id">
					<div class="form-group">
						<label for="up_perm_name" class="col-sm-2 control-label">名称</label>

						<div class="col-sm-10">
							<input type="text" class="form-control" id="up_perm_name"
								name="name" placeholder="name">
						</div>
					</div>

					<div class="form-group">
						<label for="up_perm_permission" class="col-sm-2 control-label">映射</label>

						<div class="col-sm-10">
							<input type="text" class="form-control" id="up_perm_permission"
								name="stringPermission" placeholder="permission">
						</div>
					</div>

					<div class="form-group">
						<label for="up_perm_icon" class="col-sm-2 control-label">图标</label>

						<div class="col-sm-10">
							<select id="up_perm_icon" class="form-control select2" style="width:80px"></select>
						</div>
					</div>

					<div class="form-group">
						<div class="col-sm-12">
							<button type="reset" class="btn btn-warning pull-left">重置</button>
							<button type="button" class="btn btn-info pull-right"
								id="up_permission_submit_btn_id">提交</button>
						</div>
					</div>
				</form>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
</div>


<div class="modal fade modalIndex" id="add_role_Modal" role="dialog">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h4 class="modal-title">添加角色</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" action="#" id="add_role_form_id">
					<div class="form-group">
						<label for="add_role_name" class="col-sm-2 control-label">名称</label>

						<div class="col-sm-10">
							<input type="text" class="form-control" id="add_role_name"
								name="name" placeholder="name">
						</div>
					</div>

					<div class="form-group">
						<label for="add_role_role" class="col-sm-2 control-label">角色</label>

						<div class="col-sm-10">
							<input type="text" class="form-control" id="add_role_role"
								name="stringRole" placeholder="role">
						</div>
					</div>

					<div class="form-group">
						<div class="col-sm-12">
							<button type="reset" class="btn btn-warning pull-left">重置</button>
							<button type="button" class="btn btn-info pull-right"
								id="add_role_submit_btn_id">提交</button>
						</div>
					</div>
				</form>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
</div>


<div class="modal fade modalIndex" id="up_role_Modal" role="dialog">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h4 class="modal-title">修改角色</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" action="#" id="up_role_form_id">
					<div class="form-group">
						<label for="up_role_name" class="col-sm-2 control-label">名称</label>

						<div class="col-sm-10">
							<input type="text" class="form-control" id="up_role_name"
								name="name" placeholder="name">
						</div>
					</div>

					<div class="form-group">
						<label for="up_role_role" class="col-sm-2 control-label">角色</label>

						<div class="col-sm-10">
							<input type="text" class="form-control" id="up_role_role"
								name="stringRole" placeholder="role">
						</div>
					</div>
					

					<div class="form-group">
						<div class="col-sm-12">
							<button type="button" class="btn btn-info pull-right"
								id="up_role_submit_btn_id">提交</button>
						</div>
					</div>
				</form>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
</div>

	<script type="text/javascript">
	var role_section_id = 'role_html_section_id';
	var permission_section_id = 'permission_html_section_id';
	if($('#'+role_section_id).length>0)
		$('#'+role_section_id).remove();
	if($('#'+permission_section_id).length>0)
		$('#'+permission_section_id).remove();
	</script>

	<script type="text/javascript"
		src="/static/zTree_v3/js/jquery.ztree.all.min.js"></script>
	<script type="text/javascript" src="/static/permission.js"></script>
	<script type="text/javascript" src="/static/role.js"></script>
	<script type="text/javascript" src="/static/role_permission.js"></script>